﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using G28BS.Models;

namespace G28BS.Tests.MockObjects
{
    class MockAppRepository : IAppRepository
    {
        private List<UserProfile> _userProfiles = new List<UserProfile>();
        private List<GameRoom> _gameRooms = new List<GameRoom>();
        private List<FinishedGame> _finishedGames = new List<FinishedGame>();
        private List<Slot> _slots = new List<Slot>();
        private List<Invitation> _invitations = new List<Invitation>();
        private List<Game> _games = new List<Game>();
        private List<GameResult> _gameResults = new List<GameResult>();
        private List<Event> _events = new List<Event>();
        private List<Group> _groups = new List<Group>();
        private List<Tournament> _tournaments = new List<Tournament>();
        //private List<Rank> _rank = new List<Rank>();
        private List<RankmkII> _rankII = new List<RankmkII>();
        private List<Error> _errors = new List<Error>();

        private List<tttResult> _tttresult = new List<tttResult>();

        public IEnumerable<UserProfile> userProfiles
        {
            get
            {
                return _userProfiles;
            }
        }

        public IEnumerable<GameRoom> gameRooms
        {
            get
            {
                return _gameRooms;
            }
        }

        public IEnumerable<FinishedGame> finishedGames
        {
            get
            {
                return _finishedGames;
            }
        }

        public IEnumerable<Slot> slots
        {
            get
            {
                return _slots;
            }
        }

        public IEnumerable<Invitation> invitations
        {
            get
            {
                return _invitations;
            }
        }

        public IEnumerable<Game> games
        {
            get
            {
                return _games;
            }
        }

        public IEnumerable<GameResult> gameResults
        {
            get
            {
                return _gameResults;
            }
        }

        public IEnumerable<Event> events
        {
            get
            {
                return _events;
            }
        }

        public IEnumerable<Group> groups
        {
            get
            {
                return _groups;
            }
        }

        public IEnumerable<Tournament> tournaments
        {
            get
            {
                return _tournaments;
            }
        }

        //public IEnumerable<Rank> ranks
        //{
        //    get
        //    {
        //        return _rank;
        //    }
        //}

        public IEnumerable<RankmkII> rankIIs
        {
            get
            {
                return _rankII;
            }
        }


        public IEnumerable<tttResult> tttresults
        {
            get
            {
                return _tttresult;
            }
        }

        public IEnumerable<Error> errors
        {
            get
            {
                return _errors;
            }
        }

        // Allow to add users to Mock. Not allowed for actual repository.
        public void AddUserProfile(UserProfile userProfile)
        {
            _userProfiles.Add(userProfile);
        }

        public void AddGameRoom(GameRoom gameRoom)
        {
            _gameRooms.Add(gameRoom);
        }

        public void AddFinishedGame(FinishedGame finishedGame)
        {
            _finishedGames.Add(finishedGame);
        }

        public void AddSlots(List<Slot> slots)
        {
            foreach (var slot in slots)
            {
                _slots.Add(slot);    
            }
        }

        public void AddInvitation(Invitation invitation)
        {
            _invitations.Add(invitation);
        }

        public void AddGame(Game game)
        {
            _games.Add(game);
        }

        public void AddGameResult(GameResult gameResult)
        {
            _gameResults.Add(gameResult);
        }

        public void AddEvent(Event e)
        {
            _events.Add(e);
        }

        public void AddGroup(Group group)
        {
            _groups.Add(group);
        }

        public void AddTournament(Tournament tournament)
        {
            _tournaments.Add(tournament);
        }

        //public void AddRank(Rank rank)
        //{
        //    _rank.Add(rank);
        //}

        public void AddRankII(RankmkII rankII)
        {
            _rankII.Add(rankII);
        }

        public void AddtttResult(tttResult tttresult)
        {
            _tttresult.Add(tttresult);
        }

        public void AddError(Error error)
        {
            _errors.Add(error);
        }

        public void Save()
        {
            return;
        }
    }
}
